<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - gil/image.hpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../index.html">directory</a> - <a href="index.html">gil</a> - image.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">44</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">93.2 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">41</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : /*
<span class="lineNum">       2 </span>                :     Copyright 2005-2007 Adobe Systems Incorporated
<span class="lineNum">       3 </span>                :    
<span class="lineNum">       4 </span>                :     Use, modification and distribution are subject to the Boost Software License,
<span class="lineNum">       5 </span>                :     Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       6 </span>                :     http://www.boost.org/LICENSE_1_0.txt).
<span class="lineNum">       7 </span>                : 
<span class="lineNum">       8 </span>                :     See http://opensource.adobe.com/gil for most recent version including documentation.
<span class="lineNum">       9 </span>                : */
<span class="lineNum">      10 </span>                : /*************************************************************************************************/
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span>                : #ifndef GIL_IMAGE_H
<span class="lineNum">      13 </span>                : #define GIL_IMAGE_H
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                : ////////////////////////////////////////////////////////////////////////////////////////
<span class="lineNum">      16 </span>                : /// \file               
<span class="lineNum">      17 </span>                : /// \brief Templated image
<span class="lineNum">      18 </span>                : /// \author Lubomir Bourdev and Hailin Jin \n
<span class="lineNum">      19 </span>                : ///         Adobe Systems Incorporated
<span class="lineNum">      20 </span>                : /// \date 2005-2007 \n Last updated on February 12, 2007
<span class="lineNum">      21 </span>                : ///
<span class="lineNum">      22 </span>                : ////////////////////////////////////////////////////////////////////////////////////////
<span class="lineNum">      23 </span>                : 
<span class="lineNum">      24 </span>                : #include &lt;cstddef&gt;
<span class="lineNum">      25 </span>                : #include &lt;memory&gt;
<span class="lineNum">      26 </span>                : #include &quot;gil_config.hpp&quot;
<span class="lineNum">      27 </span>                : #include &quot;image_view.hpp&quot;
<span class="lineNum">      28 </span>                : #include &quot;metafunctions.hpp&quot;
<span class="lineNum">      29 </span>                : #include &quot;algorithm.hpp&quot;
<span class="lineNum">      30 </span>                : 
<span class="lineNum">      31 </span>                : namespace boost { namespace gil {
<span class="lineNum">      32 </span>                : 
<span class="lineNum">      33 </span>                : //#ifdef _MSC_VER
<span class="lineNum">      34 </span>                : //#pragma warning(push)
<span class="lineNum">      35 </span>                : //#pragma warning(disable : 4244)     // conversion from 'gil::image&lt;V,Alloc&gt;::coord_t' to 'int', possible loss of data (visual studio compiler doesn't realize that the two types are the same)
<span class="lineNum">      36 </span>                : //#endif
<span class="lineNum">      37 </span>                : 
<span class="lineNum">      38 </span>                : ////////////////////////////////////////////////////////////////////////////////////////
<span class="lineNum">      39 </span>                : /// \ingroup ImageModel PixelBasedModel
<span class="lineNum">      40 </span>                : /// \brief container interface over image view. Models ImageConcept, PixelBasedConcept
<span class="lineNum">      41 </span>                : /// 
<span class="lineNum">      42 </span>                : /// A 2D container whose elements are pixels. It is templated over the pixel type, a boolean
<span class="lineNum">      43 </span>                : /// indicating whether it should be planar, and an optional allocator.
<span class="lineNum">      44 </span>                : ///
<span class="lineNum">      45 </span>                : /// Note that its element type does not have to be a pixel. \p image can be instantiated with any Regular element, 
<span class="lineNum">      46 </span>                : /// in which case it models the weaker RandomAccess2DImageConcept and does not model PixelBasedConcept
<span class="lineNum">      47 </span>                : ///
<span class="lineNum">      48 </span>                : ////////////////////////////////////////////////////////////////////////////////////////
<span class="lineNum">      49 </span>                : 
<span class="lineNum">      50 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;    
<span class="lineNum">      51 </span>                : class image {
<span class="lineNum">      52 </span>                : public:
<span class="lineNum">      53 </span>                :     typedef typename Alloc::template rebind&lt;unsigned char&gt;::other allocator_type;
<span class="lineNum">      54 </span>                :     typedef typename view_type_from_pixel&lt;Pixel, IsPlanar&gt;::type view_t;
<span class="lineNum">      55 </span>                :     typedef typename view_t::const_t                 const_view_t;
<span class="lineNum">      56 </span>                :     typedef typename view_t::point_t                 point_t;
<span class="lineNum">      57 </span>                :     typedef typename view_t::coord_t                 coord_t;
<span class="lineNum">      58 </span>                :     typedef typename view_t::value_type              value_type;
<span class="lineNum">      59 </span>                :     typedef coord_t                                  x_coord_t;
<span class="lineNum">      60 </span>                :     typedef coord_t                                  y_coord_t;
<span class="lineNum">      61 </span>                : 
<span class="lineNum">      62 </span><span class="lineCov">              2 :     const point_t&amp;          dimensions()            const { return _view.dimensions(); }</span>
<span class="lineNum">      63 </span>                :     x_coord_t               width()                 const { return _view.width(); }
<span class="lineNum">      64 </span>                :     y_coord_t               height()                const { return _view.height(); }
<span class="lineNum">      65 </span>                : 
<span class="lineNum">      66 </span>                :     explicit image(std::size_t alignment=0,
<span class="lineNum">      67 </span><span class="lineCov">              8 :                    const Alloc alloc_in = Alloc()) : </span>
<span class="lineNum">      68 </span><span class="lineCov">              8 :         _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {}</span>
<span class="lineNum">      69 </span>                : 
<span class="lineNum">      70 </span>                :     // Create with dimensions and optional initial value and alignment
<span class="lineNum">      71 </span>                :     image(const point_t&amp; dimensions,
<span class="lineNum">      72 </span>                :           std::size_t alignment=0,
<span class="lineNum">      73 </span><span class="lineCov">              7 :                   const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {</span>
<span class="lineNum">      74 </span><span class="lineCov">              7 :         allocate_and_default_construct(dimensions);</span>
<span class="lineNum">      75 </span><span class="lineCov">              7 :     }</span>
<span class="lineNum">      76 </span>                :     image(x_coord_t width, y_coord_t height,
<span class="lineNum">      77 </span>                :           std::size_t alignment=0,
<span class="lineNum">      78 </span>                :                   const Alloc alloc_in = Alloc()) : _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
<span class="lineNum">      79 </span>                :         allocate_and_default_construct(point_t(width,height));
<span class="lineNum">      80 </span>                :     }
<span class="lineNum">      81 </span>                :     image(const point_t&amp; dimensions, 
<span class="lineNum">      82 </span>                :           const Pixel&amp; p_in,
<span class="lineNum">      83 </span>                :           std::size_t alignment,
<span class="lineNum">      84 </span>                :           const Alloc alloc_in = Alloc())  :
<span class="lineNum">      85 </span>                :         _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
<span class="lineNum">      86 </span>                :         allocate_and_fill(dimensions, p_in);
<span class="lineNum">      87 </span>                :     }
<span class="lineNum">      88 </span>                :     image(x_coord_t width, y_coord_t height,
<span class="lineNum">      89 </span>                :           const Pixel&amp; p_in,
<span class="lineNum">      90 </span>                :           std::size_t alignment,
<span class="lineNum">      91 </span>                :           const Alloc alloc_in = Alloc())  :
<span class="lineNum">      92 </span>                :         _memory(0), _align_in_bytes(alignment), _alloc(alloc_in) {
<span class="lineNum">      93 </span>                :         allocate_and_fill(point_t(width,height),p_in);
<span class="lineNum">      94 </span>                :     }
<span class="lineNum">      95 </span>                : 
<span class="lineNum">      96 </span>                :     image(const image&amp; img) :
<span class="lineNum">      97 </span>                :         _memory(0), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc) {
<span class="lineNum">      98 </span>                :         allocate_and_copy(img.dimensions(),img._view);
<span class="lineNum">      99 </span>                :     }
<span class="lineNum">     100 </span>                : 
<span class="lineNum">     101 </span>                :     template &lt;typename P2, bool IP2, typename Alloc2&gt;
<span class="lineNum">     102 </span>                :     image(const image&lt;P2,IP2,Alloc2&gt;&amp; img) : 
<span class="lineNum">     103 </span>                :         _memory(0), _align_in_bytes(img._align_in_bytes), _alloc(img._alloc) {
<span class="lineNum">     104 </span>                :        allocate_and_copy(img.dimensions(),img._view);
<span class="lineNum">     105 </span>                :     }
<span class="lineNum">     106 </span>                :     image&amp; operator=(const image&amp; img) {
<span class="lineNum">     107 </span>                :         if (dimensions() == img.dimensions())
<span class="lineNum">     108 </span>                :             copy_pixels(img._view,_view);
<span class="lineNum">     109 </span>                :         else {
<span class="lineNum">     110 </span>                :             image tmp(img);
<span class="lineNum">     111 </span>                :             swap(tmp);
<span class="lineNum">     112 </span>                :         }
<span class="lineNum">     113 </span>                :         return *this;
<span class="lineNum">     114 </span>                :     }
<span class="lineNum">     115 </span>                : 
<span class="lineNum">     116 </span>                :     template &lt;typename Img&gt;
<span class="lineNum">     117 </span>                :     image&amp; operator=(const Img&amp; img) {
<span class="lineNum">     118 </span>                :         if (dimensions() == img.dimensions())
<span class="lineNum">     119 </span>                :             copy_pixels(img._view,_view);
<span class="lineNum">     120 </span>                :         else {
<span class="lineNum">     121 </span>                :             image tmp(img);
<span class="lineNum">     122 </span>                :             swap(tmp);
<span class="lineNum">     123 </span>                :         }
<span class="lineNum">     124 </span>                :         return *this;
<span class="lineNum">     125 </span>                :     }
<span class="lineNum">     126 </span>                : 
<span class="lineNum">     127 </span><span class="lineCov">             15 :     ~image() {</span>
<span class="lineNum">     128 </span><span class="lineCov">             15 :         destruct_pixels(_view);</span>
<span class="lineNum">     129 </span><span class="lineCov">             15 :         deallocate(_view.dimensions());</span>
<span class="lineNum">     130 </span><span class="lineCov">             15 :     }</span>
<span class="lineNum">     131 </span>                : 
<span class="lineNum">     132 </span>                :     Alloc&amp;       allocator() { return _alloc; }
<span class="lineNum">     133 </span>                :     Alloc const&amp; allocator() const { return _alloc; }
<span class="lineNum">     134 </span>                : 
<span class="lineNum">     135 </span><span class="lineCov">              6 :     void swap(image&amp; img) { // required by MutableContainerConcept</span>
<span class="lineNum">     136 </span>                :         using std::swap;
<span class="lineNum">     137 </span><span class="lineCov">              6 :         swap(_align_in_bytes, img._align_in_bytes);</span>
<span class="lineNum">     138 </span><span class="lineCov">              6 :         swap(_memory,         img._memory);</span>
<span class="lineNum">     139 </span><span class="lineCov">              6 :         swap(_view,           img._view); </span>
<span class="lineNum">     140 </span><span class="lineCov">              6 :         swap(_alloc,          img._alloc);</span>
<span class="lineNum">     141 </span><span class="lineCov">              6 :     }    </span>
<span class="lineNum">     142 </span>                : 
<span class="lineNum">     143 </span><span class="lineCov">              6 :     void recreate(const point_t&amp; dims, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {</span>
<span class="lineNum">     144 </span><span class="lineCov">              6 :         if (dims!=_view.dimensions() || _align_in_bytes!=alignment || alloc_in!=_alloc) {</span>
<span class="lineNum">     145 </span><span class="lineCov">              6 :             image tmp(dims, alignment, alloc_in);</span>
<span class="lineNum">     146 </span><span class="lineCov">             12 :             swap(tmp);</span>
<span class="lineNum">     147 </span>                :         }
<span class="lineNum">     148 </span><span class="lineCov">              6 :     }</span>
<span class="lineNum">     149 </span>                :     void recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {
<span class="lineNum">     150 </span>                :         recreate(point_t(width,height),alignment,alloc_in);
<span class="lineNum">     151 </span>                :     }
<span class="lineNum">     152 </span>                :     void recreate(const point_t&amp; dims, 
<span class="lineNum">     153 </span>                :                   const Pixel&amp; p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) {
<span class="lineNum">     154 </span>                :         if (dims!=_view.dimensions() || _align_in_bytes!=alignment || alloc_in!=_alloc) {
<span class="lineNum">     155 </span>                :             image tmp(dims, p_in, alignment, alloc_in);
<span class="lineNum">     156 </span>                :             swap(tmp);
<span class="lineNum">     157 </span>                :         }
<span class="lineNum">     158 </span>                :     }
<span class="lineNum">     159 </span>                :     void recreate(x_coord_t width, y_coord_t height, 
<span class="lineNum">     160 </span>                :                   const Pixel&amp; p_in, std::size_t alignment, const Alloc alloc_in = Alloc()) {
<span class="lineNum">     161 </span>                :         recreate(point_t(width,height),p_in,alignment,alloc_in);
<span class="lineNum">     162 </span>                :     }
<span class="lineNum">     163 </span>                : 
<span class="lineNum">     164 </span>                :     view_t       _view;      // contains pointer to the pixels, the image size and ways to navigate pixels
<span class="lineNum">     165 </span>                : private:
<span class="lineNum">     166 </span>                :     unsigned char* _memory;
<span class="lineNum">     167 </span>                :     std::size_t    _align_in_bytes;
<span class="lineNum">     168 </span>                :     allocator_type _alloc;
<span class="lineNum">     169 </span>                : 
<span class="lineNum">     170 </span><span class="lineCov">              7 :     void allocate_and_default_construct(const point_t&amp; dimensions) { </span>
<span class="lineNum">     171 </span>                :         try {
<span class="lineNum">     172 </span><span class="lineCov">              7 :             allocate_(dimensions,mpl::bool_&lt;IsPlanar&gt;());</span>
<span class="lineNum">     173 </span><span class="lineCov">              7 :             default_construct_pixels(_view);</span>
<span class="lineNum">     174 </span><span class="lineNoCov">              0 :         } catch(...) { deallocate(dimensions); throw; }</span>
<span class="lineNum">     175 </span><span class="lineCov">              7 :     }</span>
<span class="lineNum">     176 </span>                : 
<span class="lineNum">     177 </span>                :     void allocate_and_fill(const point_t&amp; dimensions, const Pixel&amp; p_in) { 
<span class="lineNum">     178 </span>                :         try {
<span class="lineNum">     179 </span>                :             allocate_(dimensions,mpl::bool_&lt;IsPlanar&gt;());
<span class="lineNum">     180 </span>                :             uninitialized_fill_pixels(_view, p_in);
<span class="lineNum">     181 </span>                :         } catch(...) { deallocate(dimensions); throw; }
<span class="lineNum">     182 </span>                :     }
<span class="lineNum">     183 </span>                : 
<span class="lineNum">     184 </span>                :     template &lt;typename View&gt;
<span class="lineNum">     185 </span>                :     void allocate_and_copy(const point_t&amp; dimensions, const View&amp; v) { 
<span class="lineNum">     186 </span>                :         try {
<span class="lineNum">     187 </span>                :             allocate_(dimensions,mpl::bool_&lt;IsPlanar&gt;());
<span class="lineNum">     188 </span>                :             uninitialized_copy_pixels(v,_view);
<span class="lineNum">     189 </span>                :         } catch(...) { deallocate(dimensions); throw; }
<span class="lineNum">     190 </span>                :     }
<span class="lineNum">     191 </span>                : 
<span class="lineNum">     192 </span><span class="lineCov">             15 :     void deallocate(const point_t&amp; dimensions) { </span>
<span class="lineNum">     193 </span><span class="lineCov">             15 :         if (_memory) _alloc.deallocate(_memory, total_allocated_size_in_bytes(dimensions));</span>
<span class="lineNum">     194 </span><span class="lineCov">             15 :     }</span>
<span class="lineNum">     195 </span>                : 
<span class="lineNum">     196 </span><span class="lineCov">             14 :     std::size_t total_allocated_size_in_bytes(const point_t&amp; dimensions) const {</span>
<span class="lineNum">     197 </span><span class="lineCov">             14 :         std::size_t size_in_units = get_row_size_in_memunits(dimensions.x)*dimensions.y;</span>
<span class="lineNum">     198 </span>                :                 if (IsPlanar)
<span class="lineNum">     199 </span>                :                         size_in_units = size_in_units*num_channels&lt;view_t&gt;::value;
<span class="lineNum">     200 </span>                : 
<span class="lineNum">     201 </span>                :         // return the size rounded up to the nearest byte
<span class="lineNum">     202 </span>                :         return (size_in_units + byte_to_memunit&lt;typename view_t::x_iterator&gt;::value - 1) / byte_to_memunit&lt;typename view_t::x_iterator&gt;::value
<span class="lineNum">     203 </span><span class="lineCov">             14 :                         + (_align_in_bytes&gt;0 ? _align_in_bytes-1:0); // add extra padding in case we need to align the first image pixel</span>
<span class="lineNum">     204 </span>                :     }
<span class="lineNum">     205 </span>                : 
<span class="lineNum">     206 </span><span class="lineCov">             21 :     std::size_t get_row_size_in_memunits(x_coord_t width) const {   // number of units per row</span>
<span class="lineNum">     207 </span><span class="lineCov">             21 :                 std::size_t size_in_memunits = width*memunit_step(typename view_t::x_iterator());</span>
<span class="lineNum">     208 </span><span class="lineCov">             21 :                 if (_align_in_bytes&gt;0) {</span>
<span class="lineNum">     209 </span><span class="lineNoCov">              0 :                         std::size_t alignment_in_memunits=_align_in_bytes*byte_to_memunit&lt;typename view_t::x_iterator&gt;::value;</span>
<span class="lineNum">     210 </span><span class="lineNoCov">              0 :                         return align(size_in_memunits, alignment_in_memunits);</span>
<span class="lineNum">     211 </span>                :                 }
<span class="lineNum">     212 </span><span class="lineCov">             21 :                 return size_in_memunits;</span>
<span class="lineNum">     213 </span>                :     }
<span class="lineNum">     214 </span>                :     
<span class="lineNum">     215 </span><span class="lineCov">              7 :     void allocate_(const point_t&amp; dimensions, mpl::false_) {  // if it throws and _memory!=0 the client must deallocate _memory</span>
<span class="lineNum">     216 </span><span class="lineCov">              7 :         _memory=_alloc.allocate(total_allocated_size_in_bytes(dimensions));</span>
<span class="lineNum">     217 </span><span class="lineCov">              7 :                 unsigned char* tmp=(_align_in_bytes&gt;0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;</span>
<span class="lineNum">     218 </span><span class="lineCov">              7 :         _view=view_t(dimensions,typename view_t::locator(typename view_t::x_iterator(tmp),get_row_size_in_memunits(dimensions.x)));</span>
<span class="lineNum">     219 </span><span class="lineCov">              7 :     }</span>
<span class="lineNum">     220 </span>                : 
<span class="lineNum">     221 </span>                :     void allocate_(const point_t&amp; dimensions, mpl::true_) {   // if it throws and _memory!=0 the client must deallocate _memory
<span class="lineNum">     222 </span>                :         std::size_t row_size=get_row_size_in_memunits(dimensions.x);
<span class="lineNum">     223 </span>                :         std::size_t plane_size=row_size*dimensions.y;
<span class="lineNum">     224 </span>                :         _memory=_alloc.allocate(total_allocated_size_in_bytes(dimensions));
<span class="lineNum">     225 </span>                :                 unsigned char* tmp=(_align_in_bytes&gt;0) ? (unsigned char*)align((std::size_t)_memory,_align_in_bytes) : _memory;
<span class="lineNum">     226 </span>                :         typename view_t::x_iterator first; 
<span class="lineNum">     227 </span>                :         for (int i=0; i&lt;num_channels&lt;view_t&gt;::value; ++i) {
<span class="lineNum">     228 </span>                :             dynamic_at_c(first,i) = (typename channel_type&lt;view_t&gt;::type*)tmp;
<span class="lineNum">     229 </span>                :             memunit_advance(dynamic_at_c(first,i), plane_size*i);
<span class="lineNum">     230 </span>                :         }
<span class="lineNum">     231 </span>                :         _view=view_t(dimensions, typename view_t::locator(first, row_size));
<span class="lineNum">     232 </span>                :     }
<span class="lineNum">     233 </span>                : };
<span class="lineNum">     234 </span>                : 
<span class="lineNum">     235 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt;
<span class="lineNum">     236 </span>                : void swap(image&lt;Pixel, IsPlanar, Alloc&gt;&amp; im1,image&lt;Pixel, IsPlanar, Alloc&gt;&amp; im2) {
<span class="lineNum">     237 </span>                :     im1.swap(im2); 
<span class="lineNum">     238 </span>                : }
<span class="lineNum">     239 </span>                : 
<span class="lineNum">     240 </span>                : template &lt;typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2&gt;
<span class="lineNum">     241 </span>                : bool operator==(const image&lt;Pixel1,IsPlanar1,Alloc1&gt;&amp; im1,const image&lt;Pixel2,IsPlanar2,Alloc2&gt;&amp; im2) {
<span class="lineNum">     242 </span>                :     if ((void*)(&amp;im1)==(void*)(&amp;im2)) return true;
<span class="lineNum">     243 </span>                :     if (const_view(im1).dimensions()!=const_view(im2).dimensions()) return false;
<span class="lineNum">     244 </span>                :     return equal_pixels(const_view(im1),const_view(im2));
<span class="lineNum">     245 </span>                : }
<span class="lineNum">     246 </span>                : template &lt;typename Pixel1, bool IsPlanar1, typename Alloc1, typename Pixel2, bool IsPlanar2, typename Alloc2&gt;
<span class="lineNum">     247 </span>                : bool operator!=(const image&lt;Pixel1,IsPlanar1,Alloc1&gt;&amp; im1,const image&lt;Pixel2,IsPlanar2,Alloc2&gt;&amp; im2) {return !(im1==im2);}
<span class="lineNum">     248 </span>                : 
<span class="lineNum">     249 </span>                : ///@{
<span class="lineNum">     250 </span>                : /// \name view, const_view
<span class="lineNum">     251 </span>                : /// \brief Get an image view from an image
<span class="lineNum">     252 </span>                : 
<span class="lineNum">     253 </span>                : /// \ingroup ImageModel
<span class="lineNum">     254 </span>                : 
<span class="lineNum">     255 </span>                : /// \brief Returns the non-constant-pixel view of an image
<span class="lineNum">     256 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt; inline 
<span class="lineNum">     257 </span><span class="lineCov">             24 : const typename image&lt;Pixel,IsPlanar,Alloc&gt;::view_t&amp; view(image&lt;Pixel,IsPlanar,Alloc&gt;&amp; img) { return img._view; }</span>
<span class="lineNum">     258 </span>                : 
<span class="lineNum">     259 </span>                : /// \brief Returns the constant-pixel view of an image
<span class="lineNum">     260 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt; inline 
<span class="lineNum">     261 </span>                : const typename image&lt;Pixel,IsPlanar,Alloc&gt;::const_view_t const_view(const image&lt;Pixel,IsPlanar,Alloc&gt;&amp; img) { 
<span class="lineNum">     262 </span>                :     return static_cast&lt;const typename image&lt;Pixel,IsPlanar,Alloc&gt;::const_view_t&gt;(img._view); 
<span class="lineNum">     263 </span>                : }
<span class="lineNum">     264 </span>                : ///@}
<span class="lineNum">     265 </span>                : 
<span class="lineNum">     266 </span>                : /////////////////////////////
<span class="lineNum">     267 </span>                : //  PixelBasedConcept
<span class="lineNum">     268 </span>                : /////////////////////////////
<span class="lineNum">     269 </span>                : 
<span class="lineNum">     270 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt;
<span class="lineNum">     271 </span>                : struct channel_type&lt;image&lt;Pixel,IsPlanar,Alloc&gt; &gt; : public channel_type&lt;Pixel&gt; {}; 
<span class="lineNum">     272 </span>                : 
<span class="lineNum">     273 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt;
<span class="lineNum">     274 </span>                : struct color_space_type&lt;image&lt;Pixel,IsPlanar,Alloc&gt; &gt;  : public color_space_type&lt;Pixel&gt; {};
<span class="lineNum">     275 </span>                : 
<span class="lineNum">     276 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt;
<span class="lineNum">     277 </span>                : struct channel_mapping_type&lt;image&lt;Pixel,IsPlanar,Alloc&gt; &gt; : public channel_mapping_type&lt;Pixel&gt; {};
<span class="lineNum">     278 </span>                : 
<span class="lineNum">     279 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt;
<span class="lineNum">     280 </span>                : struct is_planar&lt;image&lt;Pixel,IsPlanar,Alloc&gt; &gt; : public mpl::bool_&lt;IsPlanar&gt; {};
<span class="lineNum">     281 </span>                : 
<span class="lineNum">     282 </span>                : //#ifdef _MSC_VER
<span class="lineNum">     283 </span>                : //#pragma warning(pop)
<span class="lineNum">     284 </span>                : //#endif
<span class="lineNum">     285 </span>                : 
<span class="lineNum">     286 </span>                : } }  // namespace boost::gil
<span class="lineNum">     287 </span>                : 
<span class="lineNum">     288 </span>                : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
